package cn.usian.controller;


import cn.usian.common.R;
import cn.usian.entity.Employee;
import cn.usian.entity.Setmeal;
import cn.usian.entity.SetmealDto;
import cn.usian.service.SetmealService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
@RestController
@RequestMapping("setmeal")
public class SetmealController {
    @Resource
    private SetmealService setmealService;

    /*
    *
    * 查询
    * */
    @GetMapping("/page")
    public R<Page<Setmeal>> page(Integer page, Integer pageSize, String name){
        return setmealService.page(page,pageSize,name);
    }

    /*
    * 批量删除
    * */

    @DeleteMapping
    public  R del(long[] ids){
        setmealService.del(ids);
        return  R.success("删除成功");
    }
    //批量状态
    @PostMapping("status/{status}")
    public R status(@PathVariable("status")Integer status,long[] ids){
        return setmealService.status(status,ids);
    }
    /*
    * 添加
    * */

}
